import 'package:get_storage/get_storage.dart';

class StorageConfig {
  StorageConfig._();

  static final _box = GetStorage();

  ///token
  static const String _tokenKey = "token";

  static set token(String value) {
    _box.write(_tokenKey, value);
  }

  static String get token => _box.read<String>(_tokenKey) ?? "";

  ///是否阅读协议
  static const String _xieYiKey = "xieyi";

  static set xieYi(bool value) {
    _box.write(_xieYiKey, value);
  }

  static bool get xieYi => _box.read<bool>(_xieYiKey) ?? false;

  ///存储的oaid
  static const String _oaidKey = "oaid";

  static set oaid(String value) {
    _box.write(_oaidKey, value);
  }

  static String get oaid => _box.read<String>(_oaidKey) ?? "";

  ///报名客服信息
  static const String _servicesKey = "services";

  static set services(String value) {
    _box.write(_servicesKey, value);
  }

  static String get services => _box.read<String>(_servicesKey) ?? "";



  //退出登录
 static void logout(){
    _box.remove(token);
    _box.remove(services);
  }
}
